Skip to content

fix(ci): backport CD (Production) deploy-gate fix in hotfix-start - #767

Merged
jirhiker merged 1 commit into
stagingfrom
fix/hotfix-start-backport-deploy-gate
Jul 7, 2026
Merged

fix(ci): backport CD (Production) deploy-gate fix in hotfix-start#767
jirhiker merged 1 commit into
stagingfrom
fix/hotfix-start-backport-deploy-gate

Conversation

@jirhiker

@jirhiker jirhiker commented Jul 6, 2026

Copy link
Copy Markdown
Member

Third of three PRs fixing the "hotfix merge doesn't deploy production" bug (see #765 hotfix/v1.1.3, #766 production).

Why this one

hotfix-start.yml seeds a hotfix branch with git checkout -b <branch> <tag>, so the branch inherits CD_production.yml as it was at that tag. Every existing v1.1.x tag predates the deploy-gate fix, so any future hotfix cut from them reinherits the broken gate:

if: ${{ startsWith((github.event_name == 'workflow_call' && inputs.tag_name) || github.event.release.tag_name, 'v') }}

github.event_name is never 'workflow_call' inside a called workflow (it inherits the caller's push), so production-deploy skips on the inline path and the hotfix never ships.

Fix

After creating the branch, surgically sed-rewrite the gate (and DEPLOY_TAG) to key on inputs.tag_name. Surgical only — deliberately not copying the whole file from the default branch, whose deploy steps have diverged from older tags' code (renamed refresh-materialized-views CLI, pg_cron, Secret Manager fetch) and would break the deploy. Idempotent: skips cleanly when the gate is already current.

Committed as ci: so it doesn't cut a standalone release-please release.

🤖 Generated with Claude Code

Hotfix branches are cut from release tags via `git checkout -b <branch>
<tag>`, so they inherit whatever CD_production.yml existed at that tag.
Tags cut before the deploy-gate fix carry a `production-deploy` gate
keyed on `github.event_name == 'workflow_call'` — never true inside a
called workflow, which inherits the caller's `push` event — so
release-please's inline deploy skips and the hotfix never ships.

After creating the branch, surgically rewrite the gate to key on
`inputs.tag_name` (empty on the release-event path, so `||` falls
through). Surgical sed only, not a whole-file copy from the default
branch, whose deploy steps may not match the tag's code (e.g. the
renamed refresh-materialized-views CLI, pg_cron, Secret Manager fetch).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jirhiker
jirhiker merged commit b9f5569 into staging Jul 7, 2026
9 checks passed
@jirhiker
jirhiker deleted the fix/hotfix-start-backport-deploy-gate branch July 7, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant